home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16347 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1016 b 

  1. Path: news.synapse.net!news-admin
  2. From: phill@synapse.net (Phil Lachance)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Arrays in C and c++
  5. Date: Wed, 10 Apr 1996 05:00:12 GMT
  6. Organization: Chromatic Consulting
  7. Distribution: world
  8. Message-ID: <316b3f0c.33230328@news.synapse.net>
  9. References: <4kc929$38k@hermes.acs.unt.edu>
  10. NNTP-Posting-Host: violin-22.synapse.net
  11. X-Newsreader: Forte Agent .99d/32.182
  12.  
  13. On 8 Apr 1996 23:55:53 GMT, jnr0001@jove.acs.unt.edu (Joseph Neal
  14. Rake) wrote:
  15.  
  16. >Is it possible to do 2 dimensional arrays in C or C++?  If so, how?
  17. >
  18. You declare 2 or more dimensional arrays like:
  19. int temp[10][20];
  20. is a 10 by 20 array of int
  21.  
  22. you access the elements in the regular way.
  23.  
  24.  
  25. >This is probably a related question:  How does one do an array of strings 
  26. >in C or C++, since 1 string is already an array?
  27. >
  28. You declare it more or less the same way:
  29. char temp[10][20];
  30. where 10 is the number of strings and 20 is the length of the string.
  31.  
  32.  
  33. _________________________________
  34. Phil Lachance <phill@synapse.net>
  35.